package vn.edu.saigontech.ncms.model.comparator;

import java.util.Comparator;

import vn.edu.saigontech.ncms.model.info.Receipt;

public class ReceiptReportComparator implements Comparator<Receipt> {

	@Override
	public int compare(Receipt receipt1, Receipt receipt2) {
		String number1 = receipt1.getNumber();
		number1 = number1.substring(number1.length() - 6, number1.length());
		
		String number2 = receipt2.getNumber();
		number2 = number2.substring(number2.length() - 6, number1.length());
		
		return number1.compareTo(number2);
	}
}